package brinaryTree;

public class N404_SumOfLeftLeaves {
    public int sumOfLeftLeaves(TreeNode root) {
        if (root == null) return 0;
        int midLeaves = 0;
        if (root.left != null && root.left.left == null && root.left.right == null)
            midLeaves = root.left.val;
        return midLeaves + sumOfLeftLeaves(root.left) + sumOfLeftLeaves(root.right);
    }
}
